Bring TWAP/JIT-funding scripts + cow-sdk 9.2.2 upgrade to main#17
Merged
Conversation
Follow-up to the TWAP-from-EOA PoC. Instead of moving the full TWAP sell amount into cow-shed up front, each part is pulled just-in-time from the EOA via the ComposableCowPoller contract, so capital stays in the user's wallet between parts. - New postTwapForEOAWithJitFunds script: a 1-wei sell=buy order carries a gasless post-hook that approves the Vault Relayer and creates the TWAP on cow-shed; the EOA approves the poller for the full sell amount and registers the JIT funding schedule. The watch-tower then pulls each part on demand. - Add a minimal ComposableCowPoller contract helper and its Gnosis address.
v9 is a modular re-architecture. Migrate the composable-cow TWAP-from-EOA scripts to it: - cow-sdk 9.2.2; add sdk-composable (Twap), sdk-cow-shed (CowShedSdk) and sdk-ethers-v5-adapter, which were split out of the main package. - Set a global provider adapter (EthersV5Adapter) — v9 reads it via getGlobalAdapter() for ABI encoding, and TradingSdk/CowShedSdk take it too. - TwapData amounts are now native bigint (were ethers BigNumber). - Add runtime peer deps: ajv, cross-fetch, multiformats, @openzeppelin/merkle-tree. - Drop the obsolete 6.0.0-RC.42 patch (its changes ship in v9).
…e/twap-jit-sdk9 # Conflicts: # package.json # src/index.ts # src/scripts/composable-cow/postTwapForEOA.ts # yarn.lock
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Lands the stacked TWAP / JIT-funding work and the SDK upgrade onto
main. These reachedmainonly partially before: PR #12 was squash-merged directly tomain, while PR #14 (JIT-funded TWAP) and thecow-sdk9.2.2 upgrade were stacked onpost-twap-from-eoa/upgrade-cow-sdk-9and never propagated.Merges
upgrade-cow-sdk-9(the superset) intomain. Brings:src/scripts/composable-cow/postTwapForEOAWithJitFunds.ts(the missing JIT script)src/scripts/composable-cow/postTwapForEOA.tsupdates +cowShed.tshelpersrc/contracts/composable-cow-poller/@cowprotocol/cow-sdk6.0.0-RC.42 → 9.2.2 (package.json + yarn.lock), which also fixes the earlier package.json-vs-installed mismatchmain-only content (e.g.collateralSwapAave.tsfrom #12) is preserved.Conflict resolution
The divergence came from
mainhaving a squashed #12 vs the branch's unsquashed history. Resolved by taking the branch (9.2.2) versions ofpackage.json/yarn.lock/postTwapForEOA.ts, and unioningsrc/index.ts(keeps all imports;postTwapForEOAWithJitFundsis the active JOBS entry).Test plan
Note:
src/scripts/flash-loans/collateralSwapAave.tsstill has pre-existing type errors (unrelated to this merge; part of the collateral-swap work).